package com.shinbada.modules.sys.service;

import com.shinbada.common.utils.CacheUtils;
import com.shinbada.core.service.CrudService;
import com.shinbada.modules.sys.entity.SysConfig;
import com.shinbada.modules.sys.mapper.SysConfigMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 系统安全配置Service
 *
 * @version 2018-10-18
 */
@Service
@Transactional(readOnly = true)
public class SysConfigService extends CrudService<SysConfigMapper, SysConfig> {

    @Override
    @Transactional(readOnly = false)
    public void save(SysConfig sysConfig) {
        super.save(sysConfig);
        CacheUtils.remove("sys.config", sysConfig.getId());
    }

    @Override
    @Transactional(readOnly = false)
    public void delete(SysConfig sysConfig) {
        super.delete(sysConfig);
        CacheUtils.remove("sys.config", sysConfig.getId());
    }

}